<script>
import list from '@/mixins/list'
import columns from './columns'
import expand from './expand'
export default {
    name: 'PermissionList',
    components: {
      expand
    },
    computed: {
        columns () {
            return columns(expand, this.onRemove, this.namespace)
        }
    },
    mixins: [list]
}
</script>
<template>
    <div class="normal">
        <Table :loading="fetching" :height="tableHeight" :data="data" border :columns="columns" stripe @on-selection-change="onSelectionChange">
            <div slot="header">
                <Row type="flex">
                    <Col span="12">
                        <Button class="margin-left-10" type="success" icon="ios-trash" @click="onRemoveSelected" :disabled="!hasSelected">删除</Button>
                    </Col>
                    <Col span="12" style="text-align:right; padding-right:10px;">
                        <Select v-model="size" style="width:80px" @on-change="changePageSize">
                            <Option v-for="item in sizeList" :value="item" :key="item">{{ item }} 条/页</Option>
                        </Select>
                        <Input v-model="keyword" icon="search" @on-enter="onSearch" placeholder="按Enter键搜索..." style="width: 300px"></Input>
                    </Col>
                </Row>
            </div>
            <div slot="footer" style="float:right" class="table-footer">
                <Page :total="total" :current="current" @on-change="changePage" :page-size="size" show-elevator show-total></Page>
            </div>
        </Table>
    </div>
</template>

<style scoped>
.table-footer {
    margin-right: 30px;
}
</style>
